﻿
<link href="./gwbn_sun/css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="./gwbn_sun/js/jquery.js"></script>
<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
body{background:#fff;color:#333;font-family:"Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;}
#container{width:900px;margin:50px auto;}
#chart, #chartData{border:1px solid #333;background:#ebedf2 url("./gwbn_sun/images/gradient.png") repeat-x 0 0;}
#chart{display:block;margin:0 0 50px 0;float:left;cursor:pointer;}
#chartData{width:200px;margin:0 40px 0 0;float:right;border-collapse:collapse;box-shadow:0 0 1em rgba(0, 0, 0, 0.5);-moz-box-shadow:0 0 1em rgba(0, 0, 0, 0.5);-webkit-box-shadow:0 0 1em rgba(0, 0, 0, 0.5);background-position:0 -100px;}
#chartData th, #chartData td{padding:0.5em;border:1px dotted #666;text-align:left;}
#chartData th{border-bottom:2px solid #333;text-transform:uppercase;}
#chartData td{cursor:pointer;}
#chartData td.highlight{background:#78DFE8;}
#chartData tr:hover td{background:#f0f0f0;}
</style>

<script src="./gwbn_sun/js/jquery.min.js"></script>
<!--[if IE]>
<script src="./gwbn_sun/js/excanvas.js"></script>
<![endif]-->

<script type="text/javascript" src="./gwbn_sun/js/pieChart.js"></script>
<div class="tab-pane">
   <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">城中区数据统计</h1>
        已安装分布图：
        </div>
  </div>
<div id="container">
	
		<canvas id="chart" width="600" height="500"></canvas>

		<table id="chartData">
			<tr>
                <th>社区名称</th><th>开户量：<?php num('gwbn_azkh');?></th>
		            </tr>
		            <?php
		                    $query = mysql_query("SELECT addr2,COUNT(addr2)  as COUNT FROM gwbn_azkh GROUP by addr2");
		                    $num = mysql_num_rows($query);
		                    if (!$query) {
		                        echo "err";
		                    }
		                    else{
		                        while($row=mysql_fetch_assoc($query))
		                      {
                                                    $base=range(123,75);
                                                    $R=array_rand($base,20);shuffle($R);
                                                    $G=array_rand($base,20);shuffle($G);
                                                    $B=array_rand($base,20);shuffle($B);
                                                      for ($i=0; $i < $num; $i++) {
                                                        $color[$i]='#'.dechex($R[$i]).dechex($G[$i]).dechex($B[$i]);
                                                          echo "<tr style='color:".$color[$i]."'>";
                                                      }
    		                          echo "<td>".$row['addr2']."</td>";
    		                          echo "<td>".$row['COUNT']."</td>";
                                                   echo "</tr>";
		                      }
		                    }
		            ?>
		</table>
	</div>